package com.hczoop.utils.web;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesUtil {
	
	private static Properties prop = new Properties();
	
	static {
		InputStream in = PropertiesUtil.class.getResourceAsStream("/qqconnectconfig.properties");
		try{
			prop.load(in);
		}catch(Exception e){
			e.printStackTrace();
		}finally{
			if(in != null){
				try {
					in.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
		InputStream in2 = PropertiesUtil.class.getResourceAsStream("/config.properties");
		try{
			prop.load(in2);
		}catch(Exception e){
			e.printStackTrace();
		}finally{
			if(in2 != null){
				try {
					in2.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}
	
	public static String getQQAppId(){
		return prop.getProperty("app_ID");
	}
	
	public static String getSMSClientId(){
		return prop.getProperty("CLIENT_ID");
	}
	
	public static String getSMSOpenUrl(){
		return prop.getProperty("OPEN_URI");
	}
	
	public static String getSMSClientSecret(){
		return prop.getProperty("CLIENT_SECRET");
	}
	
	public static String get(String key){
		return prop.getProperty(key);
	}
}
